package com.huaxia.day14.lock;

public class WrongTest {
    public static void main(String[] args) throws Exception{
        Thread t1 = new Thread(){
            @Override
            public void run() {
                for (int i=0;i<10000;i++){
                    Const.num++;
                }
            }
        };
        Thread t2 = new Thread(){
            @Override
            public void run() {
                for (int i=0;i<10000;i++){
                    Const.num++;
                }
            }
        };
        t1.start();
        t2.start();

        Thread.sleep(5000);
         System.out.println(Const.num);
    }

    static class Const{
        public static int num = 0;
    }
}
